<template>
    <div class="app">
        <!-- 拿到js中传来的值 -->
        <h2>setup函数:{{ counter }}</h2>
        <button @click="up">+1</button>
        <button @click="down">-1</button>
    </div>
</template>
<script>
// 从counter.js中导入要使用的函数
import usecounter from "./hooks/counter.js";
import { ref } from 'vue'
export default {
    setup() {
        return {
            // es6简写 声明函数
            ...usecounter()
        }
    }
}
</script>
<style scoped lang="less"></style>